3.5.87 \(\int (e \sec (c+d x))^{-n} (a+i a \tan (c+d x))^n \, dx\) [487]

Optimal. Leaf size=37 \[ -\frac {i (e \sec (c+d x))^{-n} (a+i a \tan (c+d x))^n}{d n} \]

[Out]

-I*(a+I*a*tan(d*x+c))^n/d/n/((e*sec(d*x+c))^n)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 37, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.036, Rules used = {3569} \begin {gather*} -\frac {i (a+i a \tan (c+d x))^n (e \sec (c+d x))^{-n}}{d n} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[c + d*x])^n/(e*Sec[c + d*x])^n,x]

[Out]

((-I)*(a + I*a*Tan[c + d*x])^n)/(d*n*(e*Sec[c + d*x])^n)

Rule 3569

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(d*
Sec[e + f*x])^m*((a + b*Tan[e + f*x])^n/(a*f*m)), x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 + b^2, 0] &
& EqQ[Simplify[m + n], 0]

Rubi steps

\begin {align*} \int (e \sec (c+d x))^{-n} (a+i a \tan (c+d x))^n \, dx &=-\frac {i (e \sec (c+d x))^{-n} (a+i a \tan (c+d x))^n}{d n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.06, size = 37, normalized size = 1.00 \begin {gather*} -\frac {i (e \sec (c+d x))^{-n} (a+i a \tan (c+d x))^n}{d n} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[c + d*x])^n/(e*Sec[c + d*x])^n,x]

[Out]

((-I)*(a + I*a*Tan[c + d*x])^n)/(d*n*(e*Sec[c + d*x])^n)

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.61, size = 874, normalized size = 23.62

method result size
risch \(\text {Expression too large to display}\) \(874\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(d*x+c))^n/((e*sec(d*x+c))^n),x,method=_RETURNVERBOSE)

[Out]

-I/n/d*exp(1/2*n*(-I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))*csgn(I/(exp(2*I
*(d*x+c))+1))-I*Pi*csgn(I/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)
))*csgn(I*a)+I*Pi*csgn(I*e/(exp(2*I*(d*x+c))+1)*exp(I*(d*x+c)))^3+I*Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(
d*x+c)))^2*csgn(I*a)-I*Pi*csgn(I/(exp(2*I*(d*x+c))+1))*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2-I*Pi*csgn
(I*e/(exp(2*I*(d*x+c))+1)*exp(I*(d*x+c)))^2*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))-I*Pi*csgn(I*e/(exp(2*I
*(d*x+c))+1)*exp(I*(d*x+c)))^2*csgn(I*e)-I*Pi*csgn(I*exp(2*I*(d*x+c)))^3-I*Pi*csgn(I*exp(I*(d*x+c)))*csgn(I*ex
p(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^2+I*Pi*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))^3-I*Pi*csgn(I/(exp(2*I*(
d*x+c))+1)*exp(2*I*(d*x+c)))^3+I*Pi*csgn(I/(exp(2*I*(d*x+c))+1))*csgn(I*exp(I*(d*x+c)))*csgn(I*exp(I*(d*x+c))/
(exp(2*I*(d*x+c))+1))+I*Pi*csgn(I/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I
*(d*x+c)))^2-I*Pi*csgn(I*a/(exp(2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^3+I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I/(exp(
2*I*(d*x+c))+1)*exp(2*I*(d*x+c)))^2-I*Pi*csgn(I*exp(2*I*(d*x+c)))*csgn(I*exp(I*(d*x+c)))^2+I*Pi*csgn(I*e/(exp(
2*I*(d*x+c))+1)*exp(I*(d*x+c)))*csgn(I*e)*csgn(I*exp(I*(d*x+c))/(exp(2*I*(d*x+c))+1))+I*Pi*csgn(I/(exp(2*I*(d*
x+c))+1)*exp(2*I*(d*x+c)))^2*csgn(I/(exp(2*I*(d*x+c))+1))+2*I*Pi*csgn(I*exp(2*I*(d*x+c)))^2*csgn(I*exp(I*(d*x+
c)))-2*ln(e)+2*ln(a)+2*ln(exp(I*(d*x+c)))))

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 84 vs. \(2 (34) = 68\).
time = 0.52, size = 84, normalized size = 2.27 \begin {gather*} -\frac {i \, a^{n} e^{\left (n \log \left (-\frac {2 i \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {\sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - 1\right ) - n \log \left (-\frac {\sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - 1\right ) - n\right )}}{d n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))^n/((e*sec(d*x+c))^n),x, algorithm="maxima")

[Out]

-I*a^n*e^(n*log(-2*I*sin(d*x + c)/(cos(d*x + c) + 1) + sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - 1) - n*log(-sin(d
*x + c)^2/(cos(d*x + c) + 1)^2 - 1) - n)/(d*n)

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 83 vs. \(2 (34) = 68\).
time = 0.37, size = 83, normalized size = 2.24 \begin {gather*} -\frac {i \, e^{\left (i \, d n x + i \, c n + n \log \left (a e^{\left (-1\right )}\right ) + n \log \left (\frac {2 \, e^{\left (i \, d x + i \, c + 1\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )\right )}}{d n \left (\frac {2 \, e^{\left (i \, d x + i \, c + 1\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{n}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))^n/((e*sec(d*x+c))^n),x, algorithm="fricas")

[Out]

-I*e^(I*d*n*x + I*c*n + n*log(a*e^(-1)) + n*log(2*e^(I*d*x + I*c + 1)/(e^(2*I*d*x + 2*I*c) + 1)))/(d*n*(2*e^(I
*d*x + I*c + 1)/(e^(2*I*d*x + 2*I*c) + 1))^n)

________________________________________________________________________________________

Sympy [A]
time = 11.01, size = 51, normalized size = 1.38 \begin {gather*} \begin {cases} x & \text {for}\: n = 0 \wedge \left (d = 0 \vee n = 0\right ) \\x \left (e \sec {\left (c \right )}\right )^{- n} \left (i a \tan {\left (c \right )} + a\right )^{n} & \text {for}\: d = 0 \\- \frac {i \left (e \sec {\left (c + d x \right )}\right )^{- n} \left (i a \tan {\left (c + d x \right )} + a\right )^{n}}{d n} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))**n/((e*sec(d*x+c))**n),x)

[Out]

Piecewise((x, Eq(n, 0) & (Eq(d, 0) | Eq(n, 0))), (x*(I*a*tan(c) + a)**n/(e*sec(c))**n, Eq(d, 0)), (-I*(I*a*tan
(c + d*x) + a)**n/(d*n*(e*sec(c + d*x))**n), True))

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(d*x+c))^n/((e*sec(d*x+c))^n),x, algorithm="giac")

[Out]

integrate((I*a*tan(d*x + c) + a)^n/(e*sec(d*x + c))^n, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int \frac {{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^n}{{\left (\frac {e}{\cos \left (c+d\,x\right )}\right )}^n} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(c + d*x)*1i)^n/(e/cos(c + d*x))^n,x)

[Out]

int((a + a*tan(c + d*x)*1i)^n/(e/cos(c + d*x))^n, x)

________________________________________________________________________________________